home *** CD-ROM | disk | FTP | other *** search
- Path: misery.millcomm.com!usenet
- From: danhicks@millcomm.com (Dan Hicks)
- Newsgroups: comp.lang.misc,comp.lang.c,comp.lang.pl1
- Subject: Re: GOTO controversy
- Date: 11 Mar 1996 03:56:51 GMT
- Organization: Millennium Communications, Inc.
- Message-ID: <4i08a3$n9a@misery.millcomm.com>
- References: <4grt4e$8fg@goanna.cs.rmit.EDU.AU> <4hl8mt$4po@newshost.cyberramp.net> <wallaceDnvoEo.7L7@netcom.com> <Do2J4D.J4K@cix.compulink.co.uk>
- Reply-To: danhicks@millcomm.com
- NNTP-Posting-Host: dial-13.roch.millcomm.com
- X-Newsreader: IBM NewsReader/2 v1.2
-
- In <Do2J4D.J4K@cix.compulink.co.uk>, jdm17@cix.compulink.co.uk ("John Meredith") writes:
- >
- >If a routine needs to perform some cleanup before returning
- >and there may be occasions where an early RETURN is required
- >(e.g. errors), then GO TO to transfer to a single clean-up-
- >and-return code block is neater than multiple copies of said
- >block. Of course if the clean-up is complex, it would warrant
- >being a separate (internal?) procedure.
-
- What would be better here would be a language that provided proper
- structure -- ie, an Exit block that would always be executed when the
- associated block is exited, whether by RETURN, GOTO, or exception. I
- once kludged this up with a macro processor and it did wonders for
- recovery-intense code -- made for much cleaner, more structured code.
- (Ran like a pig, but that was mostly due to the kludgy implementation.
- And where we used it performance wasn't that much of an issue.)
-
- Dan Hicks
- http://www.millcomm.com/~danhicks/
-
-